﻿@{
    ViewData["Title"] = "Edit";
    List<Ace.Entity.Wiki.Sort> ListSort = ViewBag.ListSort as List<Ace.Entity.Wiki.Sort>; 
}

@this.RefStyle("~/Content/webuploader/webuploader.css")
@this.RefScript("~/Content/webuploader/webuploader.js")
<style type="text/css">
    #picker { 
        line-height:20px;
        vertical-align: middle;
        margin: 0 0px 0 0;
    }
</style>

<div class="container">
    <div class="row">
        <form class="form-horizontal col-md-12"  method="post" action="/Wiki/Brand/Add">
            <fieldset>
                <div id="legend" class="">
                    <legend class="">品牌编辑</legend>
                </div>


                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon" id="basic-addon1">品牌标题</span>
                        <input type="text" class="form-control" value="" id="Title" name="Title" aria-describedby="basic-addon1">
                    </div>
                </div>

                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon" id="basic-addon2">是否置顶</span>
                        <select class="form-control" id="IsTop" name="IsTop">
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon">图片上传</span>
                        <input id="ImageUrl" name="ImageUrl" value="" type="text" class="form-control" aria-label="Amount (to the nearest dollar)" style="height: 59px;">
                        <span class="input-group-addon" id="picker">选择文件</span>
                    </div>
                </div>

                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon" id="basic-addon3">简要介绍</span>
                        <input type="text" class="form-control" value="" id="Remark" name="Remark" aria-describedby="basic-addon3">
                    </div>
                </div>

                
                <div class="form-group">
                    <input type="submit" value="提交" class="btn btn-primary" />
                </div>

            </fieldset>
    </form>

</div>



</div>
<script>
  
    var uploader = WebUploader.create({
        auto: true,
        swf: '/Content/webuploader/Uploader.swf',
        server: '/KindEditor/SaveFiles',
        pick: '#picker',
        resize: false
    });

    uploader.on('uploadSuccess', function (file, response) {
        var json = jQuery.parseJSON(response._raw);
        if (response.error == '0')
        {            
            $("#ImageUrl").val(response.url);
            
        }
        else
        {
            var msg = "上传失败，文件数据无法正确解析";
            $ace.alert(msg);
        }
    });
</script>


